/**
 * 全局 less mixin
 * @author LiuYu
 */

.scrollbar(
  @thumb-background: #dddee0,
  @thumb-background-hover: #686868,
  @track-piece-shadow: hsla(0,0%,0%,0.08),
) {
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  /* 滚动条有滑块的轨道部分 */
  ::-webkit-scrollbar-track-piece {
    background-color: transparent;
    box-shadow: inset 0 0 5px @track-piece-shadow;
    border-radius: 3px;
  }

  /* 滚动条滑块(竖向:vertical 横向:horizontal) */
  ::-webkit-scrollbar-thumb {
    cursor: pointer;
    background-color: @thumb-background;
    border-radius: 3px;
  }

  /* 滚动条滑块hover */
  ::-webkit-scrollbar-thumb:hover {
    background-color: @thumb-background-hover;
  }

  /* 同时有垂直和水平滚动条时交汇的部分 */
  ::-webkit-scrollbar-corner {
    display: block; /* 修复交汇时出现的白块 */
  }
}

.scrollbar-light {
  .scrollbar(
    hsla(0,0%,0%,0.2), hsla(0,0%,0%,0.05),
    hsla(0,0%,0%,0.15)
  );
}
